Repository navigation
Conversation
Why: During native runtime-core export on unified-memory GPUs (observed on GB10 / DGX Spark), _seed_warmup_workspaces allocated its 2 MiB operand segment and 32 MiB cuBLASLt workspace inside a module-level torch.cuda.MemPool() outside CoreStorage ownership. After full forward compilation and graph capture, the native exporter's allocation-context check rejected the unowned segment. What exactly changed: - ignition/preparation/core_storage.py: added CoreStorage.warmup_pool(), which lazily creates one persistent torch.cuda.MemPool backed by self._allocator.allocator() and registers its pool ID in self._preparation_pools. - ignition/preparation/capture.py: added an optional pool parameter to _seed_warmup_workspaces(stream, device, pool=None). In capture_forwards, when warmup_storage provides warmup_pool(), pass that pool to _seed_warmup_workspaces; otherwise call _seed_warmup_workspaces(warm, device) unchanged so non-export callers and existing 2-arg stubs keep identical behavior. - tests/preparation/test_core_storage.py and tests/preparation/test_capture_cublas_workspace_cuda.py: added unit and CUDA tests verifying pool reuse, _preparation_pools registration, and that seeding lands inside storage.warmup_pool() without polluting transient storage. Claimed benefit: Keeps cuBLASLt warmup workspace allocations inside CoreStorage-owned mappings during export so native export validation succeeds on unified-memory devices without altering non-export capture behavior or weakening any native allocation check. Supporting evidence and limitations: Ran FLARE_RUN_CUDA_TESTS=1 pytest on GB10 (spark-b23d) across tests/preparation/test_core_storage.py, tests/preparation/test_capture_cublas_workspace_cuda.py, tests/preparation/test_capture_graph_metadata.py, tests/preparation/test_capture_rank_readiness.py, and tests/preparation/test_preparation_reclamation.py (35 passed, 1 skipped on Linux for Windows-only address check). Also validated end-to-end across multiple full 75- and 79-graph Qwen3.8 runtime-core exports on GB10. Signed-off-by: Avi Fenesh <aviarchi1994@gmail.com> Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
|
A case file has been opened for 606. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe production fix is technically sound and addresses a real native-export failure path, but the new CUDA test pollutes shared state and never exercises
Walkthrough
Merge Risk: Low · up to
|
… and polish docs Why: Review of PR NVIDIA#606 identified that the initial CUDA test ran in-process alongside test_first_capture_binds_workspace_from_the_recording_pool (sharing module-level _warmup_streams[0] and cuBLASLt workspace cache state) and stubbed CoreStorage with SimpleNamespace instead of exercising real CoreStorage mappings and native RuntimeCore export. In addition, the updated _seed_warmup_workspaces docstring needed reconciliation with NVIDIA#331, self._warmup_pool was not declared in CoreStorage.__init__, and docs/preparation-development.md did not mention CoreStorage.warmup_pool(). What exactly changed: - tests/preparation/test_capture_cublas_workspace_cuda.py: replaced the in-process stub test with test_export_warmup_pool_seeds_workspace_inside_core_storage, which runs in a fresh subprocess (matching test_recorded_export_graph_cuda.py) against a real CoreStorage and ModuleImages instance, verifies _warmup_pools remains empty, asserts warmup segments lie inside CoreStorage.mappings, verifies the captured graph binds its workspace in storage.graph_pool, and writes a native RuntimeCore package. - ignition/preparation/capture.py: reconciled the _seed_warmup_workspaces docstring for both pool=None and CoreStorage.warmup_pool() paths and added a short comment explaining the 2-argument call preservation. - ignition/preparation/core_storage.py: declared self._warmup_pool = None in CoreStorage.__init__. - docs/preparation-development.md: documented CoreStorage.warmup_pool() beside transient warmup pool usage. Claimed benefit: Eliminates cross-test order dependence on _warmup_streams[0], verifies real CoreStorage mappings and native export acceptance end-to-end on CUDA, and keeps docstrings, initialization fields, and preparation docs consistent. Supporting evidence and limitations: Ran FLARE_RUN_CUDA_TESTS=1 pytest on GB10 (spark-b23d) across tests/preparation/test_core_storage.py, tests/preparation/test_capture_cublas_workspace_cuda.py, tests/preparation/test_recorded_export_graph_cuda.py, tests/preparation/test_capture_graph_metadata.py, tests/preparation/test_capture_rank_readiness.py, and tests/preparation/test_preparation_reclamation.py (36 passed, 1 skipped on Linux for Windows-only address check), plus an explicit reversed-order run of test_capture_cublas_workspace_cuda.py (2 passed). Single-GPU GB10 run only. Signed-off-by: Avi Fenesh <aviarchi1994@gmail.com> Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
|
Addressed all review items in
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeHead
Walkthrough
Merge Risk: Low · up to
|
Why
Following #331 (which addressed #266 by isolating cuBLASLt warmup workspaces off the capture stream),
_seed_warmup_workspacesallocated its 2 MiB operand segment and 32 MiB cuBLASLt warmup workspace inside a module-leveltorch.cuda.MemPool()outsideCoreStorageownership.During native runtime-core export on unified-memory GPUs (observed on NVIDIA GB10 / DGX Spark),
prepare_allocationsinheliopause/src/export/capture.rsrejected the unowned VMMMemPoolsegment after full forward compilation and graph capture:Giving
CoreStoragea dedicated persistent warmup pool backed by its own allocator (self._allocator.allocator()) and registered inself._preparation_poolspreserves all of #331's safety invariants (off-capture warmup stream, persistent backing outside transient storage,storage.pool, andstorage.graph_pool) while keeping warmup segments inside declaredCoreStorage.mappingswithout relaxing any native export check.What exactly changed
ignition/preparation/core_storage.py,ignition/preparation/capture.py):capture_forwardsalways called_seed_warmup_workspaces(warm, device), which allocated in module-level_warmup_pools[index] = torch.cuda.MemPool()even whenwarmup_storagewas aCoreStorageexport allocator.ignition/preparation/core_storage.py): declaredself._warmup_pool = NoneinCoreStorage.__init__and addedCoreStorage.warmup_pool(), lazily creating one persistenttorch.cuda.MemPool(self._allocator.allocator())and adding its ID toself._preparation_pools.ignition/preparation/capture.py): added optionalpool=Noneto_seed_warmup_workspaces(stream, device, pool=None)with an updated docstring covering bothpool=NoneandCoreStorage.warmup_pool(). Whenwarmup_storageprovideswarmup_pool(),capture_forwardspasses that pool; otherwise it preserves the exact 2-argument_seed_warmup_workspaces(warm, device)call and module-level_warmup_poolsbehavior.docs/preparation-development.md): documentedCoreStorage.warmup_pool()alongside transient warmup pool usage.tests/preparation/test_core_storage.py,tests/preparation/test_capture_cublas_workspace_cuda.py): addedtest_warmup_pool_reuses_one_core_allocator_pooland an isolated subprocess CUDA testtest_export_warmup_pool_seeds_workspace_inside_core_storagethat instantiates realCoreStorage+ModuleImages, verifies_warmup_poolsstays empty, verifies seeded warmup segments lie insideCoreStorage.mappings, verifies the captured graph binds its workspace instorage.graph_pool, and exports a nativeRuntimeCorepackage.Claimed benefit
Prevents native export failures caused by unowned warmup-seed VMM segments on unified-memory GPUs while keeping all native allocation-context checks intact and preserving non-export capture behavior.
Supporting evidence and limitations
FLARE_RUN_CUDA_TESTS=1 pytest tests/preparation/test_core_storage.py tests/preparation/test_capture_cublas_workspace_cuda.py tests/preparation/test_recorded_export_graph_cuda.py tests/preparation/test_capture_graph_metadata.py tests/preparation/test_capture_rank_readiness.py tests/preparation/test_preparation_reclamation.pyon GB10 (spark-b23d): 36 passed, 1 skipped (Windows-only address layout check on Linux).test_capture_cublas_workspace_cuda.pyin reversed order (test_export_warmup_pool_seeds_workspace_inside_core_storagebeforetest_first_capture_binds_workspace_from_the_recording_pool): 2 passed.spark-b23d).CoreStorageinstance.Discord: avi7066